package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaListadoMacro extends javax.swing.JFrame {
	private JPanel jPanel1;
	private JScrollPane jScrollPane1;
	private JRadioButton rbtnEstatus;
	private JRadioButton rbtnCordinador;
	private JRadioButton rbtnTematica;
	private JTable jTablaProyectos;
	private ButtonGroup grupoRadioButon;
	private JComboBox jComboestatus;
	private JLabel lblseleccionestatus;
	private JComboBox jCombocoordinador;
	private JLabel lblseleccionresponsable;
	private JComboBox jCombotematica;
	private JLabel lblselecciontematica;
	private JLabel lblseleccion;
	private JLabel lbltitulo;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaListadoMacro inst = new VentanaListadoMacro();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VentanaListadoMacro() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				jPanel1 = new Fondo("imagen.jpg");
				getContentPane().add(jPanel1, BorderLayout.CENTER);
				jPanel1.setLayout(null);
				jPanel1.setPreferredSize(new java.awt.Dimension(736, 434));
				{
					lbltitulo = new JLabel();
					jPanel1.add(lbltitulo);
					lbltitulo.setText("Listado Detallado de Proyectos");
					lbltitulo.setBounds(241, 29, 292, 16);
					lbltitulo.setFont(new java.awt.Font("SansSerif",1,16));
				}
				{
					lblselecciontematica = new JLabel();
					jPanel1.add(lblselecciontematica);
					lblselecciontematica.setText("Seleccione Tematica :");
					lblselecciontematica.setBounds(360, 71, 173, 16);
					lblselecciontematica.setFont(new java.awt.Font("SansSerif",1,12));
				}
				{
					ComboBoxModel jCombotematicaModel = 
							new DefaultComboBoxModel(
									new String[] { "Item One", "Item Two" });
					jCombotematica = new JComboBox();
					jPanel1.add(jCombotematica);
					jCombotematica.setModel(jCombotematicaModel);
					jCombotematica.setBounds(551, 68, 158, 23);
				}
				{
					lblseleccionresponsable = new JLabel();
					jPanel1.add(lblseleccionresponsable);
					lblseleccionresponsable.setText("Seleccione Coordinador :");
					lblseleccionresponsable.setBounds(357, 103, 181, 14);
					lblseleccionresponsable.setFont(new java.awt.Font("SansSerif",1,12));
				}
				{
					ComboBoxModel jCombocoordinadorModel = 
							new DefaultComboBoxModel(
									new String[] {});
					jCombocoordinador = new JComboBox();
					jPanel1.add(jCombocoordinador);
					jCombocoordinador.setModel(jCombocoordinadorModel);
					jCombocoordinador.setBounds(550, 99, 159, 23);
				}
				{
					lblseleccionestatus = new JLabel();
					jPanel1.add(lblseleccionestatus);
					lblseleccionestatus.setText("Seleccione el Estatus :");
					lblseleccionestatus.setBounds(357, 129, 176, 16);
					lblseleccionestatus.setFont(new java.awt.Font("SansSerif",1,12));
				}
				{
					ComboBoxModel jComboestatusModel = 
							new DefaultComboBoxModel(
									new String[] { "En Redaccion", "En Evaluacion", "Aprobado", "Rechazado","No Culminado", "Culminado" });
					jComboestatus = new JComboBox();
					jPanel1.add(jComboestatus);
					jComboestatus.setModel(jComboestatusModel);
					jComboestatus.setBounds(551, 126, 160, 23);
				}
				{
					jScrollPane1 = new JScrollPane();
					jPanel1.add(jScrollPane1);
					jScrollPane1.setBounds(34, 163, 667, 241);
					{
						TableModel jTablaProyectosModel = 
								new DefaultTableModel(
										new String[][] {  },
										new String[] {  "Codigo", "Nombre", "Nro. de Integrantes", "Responsable" });
						jTablaProyectos = new JTable();
						jScrollPane1.setViewportView(jTablaProyectos);
						jTablaProyectos.setModel(jTablaProyectosModel);
					}
				}
				{
					
					ButtonGroup bgr = new ButtonGroup();
					
					rbtnEstatus = new JRadioButton();
					jPanel1.add(rbtnEstatus);
					rbtnEstatus.setText("Estatus");
					rbtnEstatus.setBounds(46, 101, 94, 19);
					rbtnEstatus.setBackground(new java.awt.Color(255,255,255));
					rbtnEstatus.setOpaque(false);
					bgr.add(rbtnEstatus);
					
					rbtnCordinador = new JRadioButton();
					jPanel1.add(rbtnCordinador);
					rbtnCordinador.setText("Coordinador");
					rbtnCordinador.setBounds(135, 101, 118, 19);
					rbtnCordinador.setBackground(new java.awt.Color(255,255,255));
					rbtnCordinador.setOpaque(false);
					bgr.add(rbtnCordinador);
					
					rbtnTematica = new JRadioButton();
					jPanel1.add(rbtnTematica);
					rbtnTematica.setText("Tematica");
					rbtnTematica.setBounds(258, 101, 113, 19);
					rbtnTematica.setBackground(new java.awt.Color(255,255,255));
					rbtnTematica.setOpaque(false);
					bgr.add(rbtnTematica);
				}
				{
					lblseleccion = new JLabel();
					jPanel1.add(lblseleccion);
					lblseleccion.setText("Seleccione el Criterio de Consulta :");
					lblseleccion.setFont(new java.awt.Font("SansSerif",1,12));
					lblseleccion.setBounds(46, 69, 308, 20);
				}
			}
			pack();
			this.setSize(752, 460);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
//get de los combos tipo COMBO
	
public JComboBox jCombotematica(){
	return jCombotematica;
}
public JComboBox jComboestado(){
	return jComboestatus;
}
public JComboBox jCombocoordinador(){
	return jCombocoordinador;
}

public String getCombocoordinador(){
	return (String) jCombocoordinador.getSelectedItem();
}
public String getComboTematica()
{
	return (String) jCombotematica.getSelectedItem();
	}

public String getComboEstado()
	{
	return (String) jComboestatus.getSelectedItem();
	}

public void desaparecerTematica(boolean valor){
	jCombotematica.setVisible(valor);
	lblselecciontematica.setVisible(valor);
	}
public void desaparecerEstatus(boolean valor){
	jComboestatus.setVisible(valor);
	lblseleccionestatus.setVisible(valor);
	}
public void desaparecerCoordinador(boolean valor){
	jCombocoordinador.setVisible(valor);
	lblseleccionresponsable.setVisible(valor);
	}
public void agregarListener(ActionListener accion){
	rbtnCordinador.addActionListener(accion);
	rbtnEstatus.addActionListener(accion);
	rbtnTematica.addActionListener(accion);
}

public String getOpcionSeleccionada() {
	if (rbtnCordinador.isSelected())
		return rbtnCordinador.getText();
	else if (rbtnEstatus.isSelected())
		return rbtnEstatus.getText();
	else if (rbtnTematica.isSelected())
		return rbtnTematica.getText();
	else
		return "";		
}
//METODO MOSTRAR MENSAJE
public void mostrarMensaje(String mensaje) {
	JOptionPane.showMessageDialog(this, mensaje);
}

public void agregarResponsables(String line) {
	DefaultComboBoxModel modelocombo = (DefaultComboBoxModel)jCombocoordinador.getModel();
	modelocombo.addElement(line);

}
}
